home *** CD-ROM | disk | FTP | other *** search
- #!/bin/sh
-
- #**************************************************************************
- #* *
- #* Copyright (c) 1993 Silicon Graphics, Inc. *
- #* All Rights Reserved *
- #* *
- #* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI *
- #* *
- #* The copyright notice above does not evidence any actual of intended *
- #* publication of such source code, and is an unpublished work by Silicon *
- #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
- #* the property of Silicon Graphics, Inc. Any use, duplication or *
- #* disclosure not specifically authorized by Silicon Graphics is strictly *
- #* prohibited. *
- #* *
- #* RESTRICTED RIGHTS LEGEND: *
- #* *
- #* Use, duplication or disclosure by the Government is subject to *
- #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in *
- #* Technical Data and Computer Software clause at DFARS 52.227-7013, *
- #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR *
- #* Supplement. Unpublished - rights reserved under the Copyright Laws of *
- #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N. *
- #* Shoreline Blvd., Mountain View, CA 94039-7311 *
- #**************************************************************************
-
- server_protocol=$SERVER_PROTOCOL;
- server_software=$SERVER_SOFTWARE;
-
- /sbin/echo "$server_protocol 200 OK"
- /sbin/echo "Server: $server_software"
- /sbin/echo "Content-Type: text/html";
- /sbin/echo "Expires: 0\n";
-
-
- # Print header
- /sbin/echo "<html>\n";
- /sbin/echo "<body bgcolor=#000000 text=#996688>\n";
- /sbin/echo "<h2>Starting EndUser Registration...</h2>\n";
- /sbin/echo "<P>\n";
- /sbin/echo "<FONT SIZE="3">It may take up to 30 seconds to start this tool.</FONT>\n";
- /sbin/echo "<BR>\n";
- /sbin/echo "<FONT SIZE="3">Please be patient.</FONT>\n";
- /sbin/echo "</P>\n";
- /sbin/echo "</body>\n";
- /sbin/echo "</html>\n";
-
-
- DISPLAY=:0.0
- export DISPLAY
-
- # Because we are starting from CGI, we need to reset the
- # $HOME so that Netscape can find the preferences file and
- # cache directory.
-
- HOME=/tmp/.custreg; export HOME
- TMPDIR=/tmp; export TMPDIR
-
- # Assuming Navigator is 3.X and Communicator is 4.X
- NSVERSION=`/usr/sbin/showprods -D1 netscape netscape_gold |egrep "Navigator|Communicator"`
-
-
- # First thing, check to see if we've already started Cust Reg
- # If so, exit. If not, continue on.......
- # Note that this section is very specific, so if the calling string changes,
- # we must change this conditional as well.
-
- found=`/sbin/ps -ef | grep "Register_To_Win" | grep -v grep`
- if [ -n "$found" ]; then
- /usr/bin/X11/xconfirm -c -B "OK" -icon progress \
- -font '-*-helvetica-medium-r-narrow--19-*-*-*-p-83-iso8859-1' \
- -t "Customer Registration has already been started..." > /dev/null
- exit
- fi
-
- # create the .netscape/cache directory so we don't get told that it
- # created one for us
- if [ ! -d $HOME/.netscape/cache ]; then
- /sbin/mkdir -p $HOME/.netscape/archive $HOME/.netscape/cache $HOME/.netscape/plugins
- fi
-
- # Get OutOfBox's copy of the preferences file for us to use
- case "$NSVERSION" in
- *Communicator*)
- /bin/cp /CDROM/misc/cgiPreferences4.js $HOME/.netscape/preferences.js
- ;;
- *Navigator*|*)
- /bin/cp /CDROM/misc/cgiPreferences $HOME/.netscape/preferences
- ;;
- esac
-
-
- # Get OutOfBox's plugin.list file - this cuts significant time off of startup
- # Use OutOfBox's list becuase it will be current - it was just created...
- /bin/cp /usr/people/OutOfBox/.netscape/plugin-list $HOME/.netscape/plugin-list
-
- # Get the Xdefaults file so that the File->Exit menu is available
- /bin/cp /CDROM/misc/cgiXdefaults $HOME/.Xdefaults
- /sbin/chown nobody.nobody $HOME/.Xdefaults
-
- # set up tardist info
- # SoftwareManager needs to run as a user so running as OutOfBox
- # SM. also needs display set since nobody doesn't have it set.
- /sbin/echo 'application/x-tardist; su - OutOfBox -c "/usr/sbin/SoftwareManager -a -f %s -- -display localhost:0.0"; description="SGI software distribution archive"' > $HOME/.mailcap
- /sbin/echo 'type=application/x-tardist exts=tardist icon=internal-gopher-unknown' > $HOME/.mime.types
- /sbin/chown nobody.nobody $HOME/.mailcap $HOME/.mime.types
-
- # Before the user starts System Setup, get rid of the lock file so
- # that we don't get an error next time we start. (Netscape only
- # removes the lock when you quit via File->Exit.)
- # The lock is actually a link, so we check for "-l"
- if [ -l $HOME/.netscape/lock ]; then
- /sbin/rm $HOME/.netscape/lock
- fi
-
-
-
- # Check to be sure that we have the correct Netscape version number
- # in our preferences file; we don't want the customers to see
- # the license agreement window...
-
- /usr/people/OutOfBox/bin/netscapeVsn.pl -l nobody -h $HOME
-
-
- case "$NSVERSION" in
- *Communicator*)
- # run app in background
- `/var/www/htdocs/Register/Register_To_Win -oobe`;
- ;;
- *Navigator*|*)
- # run app in background
- `/var/www/htdocs/Register/Register_To_Win -oobe`;
- ;;
- esac
-
-
-
- # turn the area black again.
- /sbin/echo "<html>\n";
- /sbin/echo "<body bgcolor=\"#000000\">\n";
- /sbin/echo "</body>\n";
- /sbin/echo "</html>\n";
-
-
- # After the System Setup has quit, clean up the temporary home directory
- if [ -d $HOME ]; then
- /bin/rm -rf $HOME
- fi
-